/*
 * @Description: 
 * @Author: Aroma
 * @Date: 2024-09-23 20:42:01
 * @LastEditors: Aroma
 * @LastEditTime: 2024-09-23 20:53:59
 * @别瞎看: 你个无脑牛马
 */
public class Outer2{
    private int oNum=10;
    private static int sNum=20;

    static class Inner2{
        private int iNum=30;
        private static int iStaticNum=40;

        public static void staticFun(){
            //静态成员方法只能访问外部类的静态成员
            //System.out.println("Outer2,oNum:"+oNum);
            //报错！！！Cannot make a static reference to the non-static field oNum。
            System.out.println("Outer2,sNum:"+sNum);
        }
        void show(){
            //静态内部方法只能访问外部类的static成员
            // System.out.println("Inner2,oNum:"+oNum);
            // 报错！！！Cannot make a static reference to the non-static field oNum。
            System.out.println("Outer2,sNum:"+sNum);
            System.out.println("Inner2,Outer2.sNum:"+Outer2.sNum);
        }
       
    }
    public void disp(){
        //创建内部类对象
        Inner2 inner2=new Inner2();
        System.out.println("Outer2,inner2.iNum"+inner2.iNum);
        System.out.println("Outer2,inner2.iStaticNum"+inner2.iStaticNum);
        System.out.println("Outer2,inner2.iStaticNum"+Inner2.iStaticNum);
    }
}